<?php


namespace App\Kuafu\User\Controller\Pos;


use App\Kuafu\Base\Controller\BaseController;
use App\Kuafu\User\Enum\UserCodeEnum;
use App\Kuafu\User\Service\AuthService;
use Illuminate\Http\Request;

class UserController extends BaseController
{

    public function getUserInfo(Request $request)
    {
        $authUser = AuthService::getAuthUser();
        if ($authUser['status'] != 0) {
            return $this->fail(UserCodeEnum::ERR_USER_STATUS, UserCodeEnum::CODE_TEXT[UserCodeEnum::ERR_USER_STATUS]);
        }
        $return = [
            'id'       => $authUser['id'],
            'username' => $authUser['username'],
            'mobile'   => $authUser['mobile'],
            'status'   => $authUser['status'],
        ];
        return $this->success($return);
    }
}
